#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	int i;
	int num=0;
	for(i=1;i<=n;i++){
		num++;
		int x=i;
		int jiou=1;
		while(x!=0){
			int dig=x%10;
			x=x/10;
			if(jiou){
				jiou=0;
				if(dig%2==0){
					num--;
					break;
				}
			}
			else{
				jiou=1;
				if(dig%2!=0){
					num--;
					break;
				}
			}
			//x=x/10;
		}
		//printf("%d ",num);
	}
	printf("%d",num);
}
